//
//  BaseViewController.h
//  BaseFrame
//
//  Created by apple on 16/9/28.
//  Copyright © 2016年 com.mxh. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"

@interface BaseViewController : UIViewController

@property (nonatomic, strong) MBProgressHUD * progressHUD;

/**
 *  显示错误的code码和信息
 *
 *       返回的code码
 *  @param message 返回的信息
 */
- (void) failureWithStatus:(NSString*)Status message:(NSString*)message;

/**
 *  显示错误信息
 *
 *  @param error 返回的错误信息
 */
- (void) showError:(NSError*)error;

/**
 *  显示大菊花
 */
-(void)showprogressHUD;

/**
 *  隐藏大菊花
 */
-(void)hiddenProgressHUD;


/**
 弹出提示框 选择相机或者相册
 
 @param selectPhotoHandle 选中或拍摄的图片
 */
- (void)selectPhotoAlbumWithSelectPhotoHandle:(void (^)(UIImage *))selectPhotoHandle;

/**
 *  拨打电话
 *
 *  @param phoneNumber 号码
 */
- (void)callPhone:(NSString *)phoneNumber;

////开始拍照
//-(void)takePhoto;
////打开本地相册
//-(void)LocalPhoto;
////当选择一张图片后进入这里
//-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary *)info;
/**
 *  刷新Tabbar状态
 */
-(void)reloadTabbarState;
//设置状态栏颜色(透明)
- (void)setStatusBarBackgroundColor:(UIColor *)color withAlpha:(CGFloat)alpha;
//设置状态栏颜色(不透明)
- (void)setStatusBarBackgroundColor:(UIColor *)color;
//获取当前时间戳
- (NSString *)currentTimeStr;

#pragma mark - method
//label构造方法
- (void)label:(UILabel *)label withFont:(UIFont *)font withText:(NSString *)text withTextColor:(UIColor *)color withTextAlignment:(NSTextAlignment)textAlignment withView:(UIView *)upSuperView;
//button构造方法
- (void)button:(UIButton *)btn withBGColor:(UIColor *)color withLayerBorderColor:(UIColor *)borderColor withLayerBorderWith:(CGFloat)borderWith withCornerRadius:(CGFloat)cornerRadius withMasksToBounds:(BOOL)masksToBounds withViwe:(UIView *)upSuperView;
//view构造方法
- (void)view:(UIView *)view withBackgroundColor:(UIColor *)backgroundColor withBorderColor:(UIColor *)borderColor withBorderWidth:(CGFloat)borderWith withCornerRadius:(CGFloat)cornerRadius withMasksToBounds:(BOOL)masksToBounds withSuperView:(UIView *)superView;
//首字母就是数字的
- (void)changeStringTypeface:(NSString *)string withFirstLoc:(NSInteger)firstLoc withSecondLocStr:(NSString *)secondLocStr withLabel:(UILabel *)label;
//判断手机号码格式是否正确
- (BOOL)valiMobile:(NSString *)mobile;
@end
